<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclmemoryobject.cpp -->
  <title>QCLMemoryObject Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLMemoryObject</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLMemoryObject Class Reference</h1>
<!-- $$$QCLMemoryObject-brief -->
<p>The QCLMemoryObject class represents an OpenCL memory object. <a href="#details">More...</a></p>
<!-- @@@QCLMemoryObject -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLMemoryObject&gt;</pre><p>Inherited by <a href="qclbuffer.html">QCLBuffer</a>, <a href="qclimage2d.html">QCLImage2D</a>, and <a href="qclimage3d.html">QCLImage3D</a>.</p>
<p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclmemoryobject-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#Access-enum">Access</a></b> { ReadWrite, WriteOnly, ReadOnly }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QCLMemoryObject::Access </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#access">access</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLContext * </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#context">context</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> cl_mem_flags </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#flags">flags</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void * </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#hostPointer">hostPointer</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> cl_mem </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#memoryId">memoryId</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#unmap">unmap</a></b> ( void * <i>ptr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#unmapAsync">unmapAsync</a></b> ( void * <i>ptr</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#operator-not-eq">operator!=</a></b> ( const QCLMemoryObject &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#operator-eq-eq">operator==</a></b> ( const QCLMemoryObject &amp; <i>other</i> ) const</td></tr>
</table>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#QCLMemoryObject">QCLMemoryObject</a></b> ( QCLContext * <i>context</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#QCLMemoryObject-2">QCLMemoryObject</a></b> ( QCLContext * <i>context</i>, cl_mem <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclmemoryobject.html#dtor.QCLMemoryObject">~QCLMemoryObject</a></b> ()</td></tr>
</table>
<a name="details"></a>
<!-- $$$QCLMemoryObject-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLMemoryObject class represents an OpenCL memory object.</p>
</div>
<!-- @@@QCLMemoryObject -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Access$$$ReadWrite$$$WriteOnly$$$ReadOnly -->
<h3 class="fn"><a name="Access-enum"></a>enum QCLMemoryObject::Access</h3>
<p>This enum defines the access mode to use when creating OpenCL memory objects.</p>
<table class="valuelist"><tr class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td  class="topAlign"><tt>QCLMemoryObject::ReadWrite</tt></td><td class=" topAlign"><tt>0x0001</tt></td><td  class="topAlign">The memory object will be read and written by a kernel.</td></tr>
<tr><td  class="topAlign"><tt>QCLMemoryObject::WriteOnly</tt></td><td class=" topAlign"><tt>0x0002</tt></td><td  class="topAlign">The memory object will be written, but not read, by a kernel.</td></tr>
<tr><td  class="topAlign"><tt>QCLMemoryObject::ReadOnly</tt></td><td class=" topAlign"><tt>0x0004</tt></td><td  class="topAlign">The memory object will be read, but not written, by a kernel.</td></tr>
</table>
<!-- @@@Access -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLMemoryObject[overload1]$$$QCLMemoryObjectQCLContext* -->
<h3 class="fn"><a name="QCLMemoryObject"></a>QCLMemoryObject::QCLMemoryObject ( <a href="qclcontext.html">QCLContext</a> * <i>context</i> = 0 )<tt> [protected]</tt></h3>
<p>Constructs a null OpenCL memory object and associates it with <i>context</i>.</p>
<!-- @@@QCLMemoryObject -->
<!-- $$$QCLMemoryObject$$$QCLMemoryObjectQCLContext*cl_mem -->
<h3 class="fn"><a name="QCLMemoryObject-2"></a>QCLMemoryObject::QCLMemoryObject ( <a href="qclcontext.html">QCLContext</a> * <i>context</i>, cl_mem <i>id</i> )<tt> [protected]</tt></h3>
<p>Constructs an OpenCL memory object from the native identifier <i>id</i>, and associates it with <i>context</i>. This class takes over ownership of <i>id</i> and will release it in the destructor.</p>
<!-- @@@QCLMemoryObject -->
<!-- $$$~QCLMemoryObject[overload1]$$$~QCLMemoryObject -->
<h3 class="fn"><a name="dtor.QCLMemoryObject"></a>QCLMemoryObject::~QCLMemoryObject ()<tt> [protected]</tt></h3>
<p>Releases this OpenCL memory object. If this is the last reference to the memory object, it will be destroyed.</p>
<!-- @@@~QCLMemoryObject -->
<!-- $$$access[overload1]$$$access -->
<h3 class="fn"><a name="access"></a><a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> QCLMemoryObject::access () const</h3>
<p>Returns the access mode that was used to create this memory object.</p>
<p>See also <a href="qclmemoryobject.html#flags">flags</a>().</p>
<!-- @@@access -->
<!-- $$$context[overload1]$$$context -->
<h3 class="fn"><a name="context"></a><a href="qclcontext.html">QCLContext</a> * QCLMemoryObject::context () const</h3>
<p>Returns the OpenCL context that created this memory object.</p>
<!-- @@@context -->
<!-- $$$flags[overload1]$$$flags -->
<h3 class="fn"><a name="flags"></a>cl_mem_flags QCLMemoryObject::flags () const</h3>
<p>Returns the flags that were used to create this memory object.</p>
<p>See also <a href="qclmemoryobject.html#access">access</a>().</p>
<!-- @@@flags -->
<!-- $$$hostPointer[overload1]$$$hostPointer -->
<h3 class="fn"><a name="hostPointer"></a>void * QCLMemoryObject::hostPointer () const</h3>
<p>Returns the host data pointer that was used to create this memory object, or null if the memory object is not directly accessible to the host.</p>
<p>See also <a href="qclmemoryobject.html#size">size</a>().</p>
<!-- @@@hostPointer -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a>bool QCLMemoryObject::isNull () const</h3>
<p>Returns true if this OpenCL memory object is null; false otherwise.</p>
<!-- @@@isNull -->
<!-- $$$memoryId[overload1]$$$memoryId -->
<h3 class="fn"><a name="memoryId"></a>cl_mem QCLMemoryObject::memoryId () const</h3>
<p>Returns the native OpenCL identifier for this memory object.</p>
<!-- @@@memoryId -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a>size_t QCLMemoryObject::size () const</h3>
<p>Returns the actual size of the data storage associated with this memory object.</p>
<p>See also <a href="qclmemoryobject.html#hostPointer">hostPointer</a>().</p>
<!-- @@@size -->
<!-- $$$unmap[overload1]$$$unmapvoid* -->
<h3 class="fn"><a name="unmap"></a>void QCLMemoryObject::unmap ( void * <i>ptr</i> )</h3>
<p>Requests that the region at <i>ptr</i> that was previously mapped from an OpenCL buffer or image be unmapped.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclmemoryobject.html#unmapAsync">unmapAsync</a>() and <a href="qclbuffer.html#map">QCLBuffer::map</a>().</p>
<!-- @@@unmap -->
<!-- $$$unmapAsync[overload1]$$$unmapAsyncvoid*constQCLEventList& -->
<h3 class="fn"><a name="unmapAsync"></a><a href="qclevent.html">QCLEvent</a> QCLMemoryObject::unmapAsync ( void * <i>ptr</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Requests that the region at <i>ptr</i> that was previously mapped from an OpenCL buffer or image be unmapped.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished.</p>
<p>Returns an event object that can be used to wait for the request to finish. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclmemoryobject.html#unmap">unmap</a>() and <a href="qclbuffer.html#mapAsync">QCLBuffer::mapAsync</a>().</p>
<!-- @@@unmapAsync -->
<!-- $$$operator!=[overload1]$$$operator!=constQCLMemoryObject& -->
<h3 class="fn"><a name="operator-not-eq"></a>bool QCLMemoryObject::operator!= ( const QCLMemoryObject &amp; <i>other</i> ) const</h3>
<p>Returns true if this OpenCL memory object is not the same as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclmemoryobject.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQCLMemoryObject& -->
<h3 class="fn"><a name="operator-eq-eq"></a>bool QCLMemoryObject::operator== ( const QCLMemoryObject &amp; <i>other</i> ) const</h3>
<p>Returns true if this OpenCL memory object is the same as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclmemoryobject.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
